<template>
    <div class="miniMove-wrap">
      <van-popup v-model="is_show_birthday_poster" :close-on-click-overlay="false" class="mmxxPop-main">
        <div class="mmxxPop_dz">
          <img class="headImg" :src="birthday_poster" @click="JumpImg('mycoupon')">
          <div class="get-url">
            <div class="close" @click="closePop"><img src="https://img.wifenxiao.com/h5-wfx/images/DZ/mmxx/close.png"></div>
          </div>
        </div>
      </van-popup>
    </div>
</template>

<script>
import { dzGetBirthdayPoster } from '@/api/dz/dzApi'
/* eslint-disable */
export default {
  name: 'birthday-poster',
  data() {
      return {
        is_show_birthday_poster: false,
        birthday_poster: ''
      }
  },
  methods: {
    // 关闭
    closePop() {
      dzGetBirthdayPoster().then(res => {
      })
      this.is_show_birthday_poster = false
    },
    JumpImg(url, data) {
      dzGetBirthdayPoster().then(res => {
      })
      this.$JumpPath(this, url, data)
    },
    init() {
      this.$Bus.$on('reloadBirthdayGift', (res) => {
        if (res.data.is_show_birthday_poster == 1) {
          this.birthday_poster = res.data.birthday_poster
          this.is_show_birthday_poster = true
        } else {
          this.is_show_birthday_poster = false
        }
      })
    },
  },
  created() {
      this.init()
  },
  beforeDestroy() {
    this.$Bus.$off('reloadBirthdayGift')
  }

}
</script>

<style lang="scss">
  .mmxxPop-main{
    background: transparent;
    height: 650px;
  }
  .mmxxPop_dz{
    width: 525px;
    height: 100%;
    .headImg{
      width: 525px;
      height: 525px;
      border-radius: 15px;
    }
    .get-url{
      margin-top: 40px;
      .close{
        margin: auto;
        width: 80px;
        height: 80px;
        img{
          width: 100%;
          height: 100;
        }
      }
    }
  }
</style>
